﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ManagerProfile.aspx.cs" Inherits="aspnet2.Manager.ManagerProfile" Trace="true" TraceMode="SortByCategory" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>无标题页</title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:Label ID="ErrorInfo" runat="server" BackColor="#CC3300"></asp:Label>
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <br />
    <br />
    <asp:LoginStatus ID="LoginStatus1" runat="server" />
    <br />
    <asp:Button ID="AddProduct" runat="server" onclick="AddProduct_Click" 
        Text="添加产品" />
    <br />
    <asp:TextBox ID="ProductName" runat="server"></asp:TextBox>
    <cc1:TextBoxWatermarkExtender ID="ProductName_TextBoxWatermarkExtender" 
        runat="server" Enabled="True" TargetControlID="ProductName" WatermarkText="产品名">
    </cc1:TextBoxWatermarkExtender>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
        ControlToValidate="ProductName" Display="None" ErrorMessage="缺少产品名"></asp:RequiredFieldValidator>
    <cc1:ValidatorCalloutExtender ID="RequiredFieldValidator1_ValidatorCalloutExtender" 
        runat="server" 
        CloseImageUrl="http://icons.iconarchive.com/icons/milosz-wlazlo/boomy/close-icon.jpg" 
        Enabled="True" TargetControlID="RequiredFieldValidator1" 
        WarningIconImageUrl="http://icons.iconarchive.com/icons/tpdkdesign.net/refresh-cl/Symbols-Warning-icon.jpg">
    </cc1:ValidatorCalloutExtender>
    <br />
    <asp:TextBox ID="ProductPrice" runat="server"></asp:TextBox>
    <cc1:TextBoxWatermarkExtender ID="ProductPrice_TextBoxWatermarkExtender" 
        runat="server" Enabled="True" TargetControlID="ProductPrice" 
        WatermarkText="产品价格">
    </cc1:TextBoxWatermarkExtender>
    <asp:CompareValidator ID="CompareValidator1" runat="server" 
        ControlToValidate="ProductPrice" Display="None" ErrorMessage="请输入正确的价格" 
        Operator="DataTypeCheck" Type="Currency"></asp:CompareValidator>
    <cc1:ValidatorCalloutExtender ID="CompareValidator1_ValidatorCalloutExtender" 
        runat="server" Enabled="True" TargetControlID="CompareValidator1">
    </cc1:ValidatorCalloutExtender>
    <br />
    <asp:DropDownList ID="DropDownList1" runat="server">
        <asp:ListItem Value="0">机器</asp:ListItem>
        <asp:ListItem Value="1">墨水</asp:ListItem>
        <asp:ListItem Value="2">涂层</asp:ListItem>
    </asp:DropDownList>
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <br />
            <br />
            <asp:GridView ID="GridProduct" runat="server" 
        onrowediting="GridView1_RowEditing" 
        onselectedindexchanged="GridProduct_SelectedIndexChanged" 
        onrowcancelingedit="GridProduct_RowCancelingEdit" 
        onrowdeleting="GridProduct_RowDeleting" 
        onrowupdating="GridProduct_RowUpdating" 
        onselectedindexchanging="GridProduct_SelectedIndexChanging" 
    onrowupdated="GridProduct_RowUpdated" CellPadding="4" ForeColor="#333333" GridLines="None" 
        >
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:CommandField ButtonType="Button" HeaderText="Edit" ShowDeleteButton="True" 
                ShowEditButton="True" ShowHeader="True" CausesValidation="False" 
                InsertText="" NewText="" UpdateText="确定" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
            <br />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="AddProduct" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    <br />
    <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <br />
            <br />
            <br />
            <asp:GridView ID="DetailProduct" runat="server" DataKeyNames="ID" 
                onrowcancelingedit="DetailProduct_RowCancelingEdit" 
                onrowediting="DetailProduct_RowEditing" 
                onrowupdating="DetailProduct_RowUpdating" 
                onselectedindexchanged="DetailProduct_SelectedIndexChanged" 
                CellPadding="4" ForeColor="#333333" GridLines="None">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:CommandField ButtonType="Button" ShowEditButton="True" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
    <p>
        &nbsp;</p>
    <asp:UpdatePanel ID="UpdatePanel3" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <br />
            <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                AllowSorting="True" AutoGenerateColumns="False" DataKeyNames="UserID,CallTime,ProductID" 
                DataSourceID="SqlDataSource1" 
                onselectedindexchanged="GridView1_SelectedIndexChanged1" 
                onselectedindexchanging="GridView1_SelectedIndexChanging" CellPadding="4" 
                ForeColor="#333333" GridLines="None">
                <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                <Columns>
                    <asp:BoundField DataField="UserName" HeaderText="用户名" 
                        SortExpression="UserName" />
                    <asp:BoundField DataField="Name" HeaderText="产品名" 
                        SortExpression="Name" />
                    <asp:BoundField DataField="CurrentPrice" HeaderText="CurrentPrice" 
                        SortExpression="CurrentPrice" />
                    <asp:BoundField DataField="Quantity" HeaderText="购买数量" 
                        SortExpression="Quantity" />
                    <asp:BoundField DataField="QuantityUnit" HeaderText="数量单位" 
                        SortExpression="QuantityUnit" />
                    <asp:BoundField DataField="CallTime" HeaderText="下单时间" 
                        SortExpression="CallTime" ReadOnly="True" />
                    <asp:BoundField DataField="Color" HeaderText="颜色" SortExpression="Color" />
                    <asp:BoundField DataField="发货信息" HeaderText="发货信息" SortExpression="发货信息" />
                    <asp:ButtonField ButtonType="Button" CommandName="Select" HeaderText="进账确认" 
                        ShowHeader="True" Text="确认" />
                </Columns>
                <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:PrintershopConnectionString3 %>" 
                
                
                SelectCommand="SELECT UserBuyProduct.UserID, UserBuyProduct.Quantity, UserBuyProduct.QuantityUnit, UserBuyProduct.CallTime, UserBuyProduct.BuyTime, UserBuyProduct.Color, PrinterUser.UserName, Product.Name, UserBuyProduct.ProductID, Product.CurrentPrice, UserBuyContact.Adress + '  ' + UserBuyContact.ZipCode + '  ' + UserBuyContact.Phone AS 发货信息 FROM UserBuyProduct INNER JOIN PrinterUser ON UserBuyProduct.UserID = PrinterUser.UserID INNER JOIN Product ON UserBuyProduct.ProductID = Product.ID LEFT OUTER JOIN UserBuyContact ON UserBuyProduct.ContactID = UserBuyContact.ContactID AND PrinterUser.UserID = UserBuyContact.UserID WHERE (UserBuyProduct.BuyTime IS NULL) ORDER BY UserBuyProduct.CallTime">
            </asp:SqlDataSource>
            <br />
            <br />
        </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="UpdatePanel4" runat="server">
        <ContentTemplate>
            <asp:Panel ID="Panel1" runat="server">
                <p>
                    服务需求：</p>
                <asp:GridView ID="UserBuyService" runat="server" AllowPaging="True" 
                    AllowSorting="True" AutoGenerateColumns="False" 
                    DataKeyNames="ServiceID,UserID,BuyTime" DataSourceID="SqlDataSource2" 
                    onselectedindexchanged="UserBuyService_SelectedIndexChanged" 
                    onselectedindexchanging="GridView2_SelectedIndexChanging" CellPadding="4" 
                    ForeColor="#333333" GridLines="None">
                    <RowStyle BackColor="#FFFBD6" ForeColor="#333333" />
                    <Columns>
                        <asp:BoundField DataField="UserName" HeaderText="用户名" 
                            SortExpression="UserName" />
                        <asp:BoundField DataField="ServiceName" HeaderText="服务名" 
                            SortExpression="ServiceName" />
                        <asp:BoundField DataField="Price" HeaderText="价格" SortExpression="Price" />
                        <asp:BoundField DataField="BuyTime" HeaderText="购买时间" 
                            SortExpression="BuyTime" />
                        <asp:CommandField ButtonType="Button" SelectText="交付服务" 
                            ShowSelectButton="True" />
                    </Columns>
                    <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#FFCC66" ForeColor="#333333" HorizontalAlign="Center" />
                    <SelectedRowStyle BackColor="#FFCC66" Font-Bold="True" ForeColor="Navy" />
                    <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
                    <AlternatingRowStyle BackColor="White" />
                </asp:GridView>
            </asp:Panel>
        </ContentTemplate>
    </asp:UpdatePanel>
    <p>
        <asp:SqlDataSource ID="SqlDataSource2" runat="server" 
            ConnectionString="<%$ ConnectionStrings:PrintershopConnectionString3 %>" 
            
            SelectCommand="SELECT UserBuyService.ServiceID, UserBuyService.UserID, UserBuyService.BuyTime, UserBuyService.Price, PrintService.ServiceName, PrinterUser.UserName FROM UserBuyService INNER JOIN PrintService ON UserBuyService.ServiceID = PrintService.ServiceID INNER JOIN PrinterUser ON UserBuyService.UserID = PrinterUser.UserID WHERE (UserBuyService.Solved = 0) ORDER BY UserBuyService.BuyTime"></asp:SqlDataSource>
    </p>
    </form>
</body>
</html>
